package com.note.simpleshop.module.system.service;

import com.note.simpleshop.entity.TbBanner;
import com.note.simpleshop.module.system.dao.BannerRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BannerService {
    @Autowired
    private BannerRepository bannerRepository;
    @Cacheable("banner_cache")
    public List<TbBanner> findByShow(Integer isShow)
    {
        return bannerRepository.findByIsShowAndIsDeleteOrderBySortAsc(isShow, TbBanner.IS_DELEETE0);
    }
}
